/* celp_fxp.h */

/**********************/
/* CELP-CODEC (FIXED) */
/* for Secure-Phone   */
/* Version 1.01,20.12 */
/* (C) 2002 by NAH6   */
/**********************/

#ifndef __CELP_FXP_H
#define __CELP_FXP_H
#ifndef EXPORT
#ifdef __cplusplus
#define EXPORT extern "C" __declspec (dllexport)
#else
#define EXPORT __declspec (dllexport)
#endif
#endif

/*------------*/
/*  INCLUDES  */
/*------------*/

#include <windows.h>

/*-----------*/
/*  DEFINES  */
/*-----------*/

#define E_CELP_FXP_NULLPTR  (-0x4201)
#define E_CELP_FXP_CODEC    (-0x4202)
#define E_CELP_FXP_INUSE    (-0x4203)

/*====*/

#define K_CELP_FXP_MAGIC  (0x36D9C4EAL)

#define K_CELP_FXP_IFVER  (0x01)
#define K_CELP_FXP_IFREV  (0x00)
#define K_CELP_FXP_IFOPT  (0x0000)

#define K_CELP_FXP_ID0    (6)
#define K_CELP_FXP_REV0   (0)

/*--------------*/
/*  STRUCTURES  */
/*--------------*/

struct codec_info
{
  unsigned long  magic;
  unsigned char  ifver;
  unsigned char  ifrev;
  unsigned short ifopt;
  unsigned char  enc_mask[32];
  unsigned char  dec_mask[32];
  void          *code;
};

/*--------------*/
/*  PROTOTYPES  */
/*--------------*/

EXPORT signed short CALLBACK codec_getinfo (struct codec_info *info);
EXPORT signed short CALLBACK codec_getrev  (unsigned char codec);

EXPORT signed short CALLBACK codec_enc_create  (unsigned char codec, \
                                                void **state);
EXPORT signed short CALLBACK codec_enc_destroy (unsigned char codec, \
                                                void *state);
EXPORT signed short CALLBACK codec_enc_data    (unsigned char codec,       \
                                                void *state,               \
                                                const signed short *audio, \
                                                unsigned char *data,       \
                                                unsigned long *alen,       \
                                                unsigned long *dlen);

EXPORT signed short CALLBACK codec_dec_create  (unsigned char codec, \
                                                void **state);
EXPORT signed short CALLBACK codec_dec_destroy (unsigned char codec, \
                                                void *state);
EXPORT signed short CALLBACK codec_dec_data    (unsigned char codec,       \
                                                void *state,               \
                                                const unsigned char *data, \
                                                signed short *audio,       \
                                                unsigned long *dlen,       \
                                                unsigned long *alen);

#endif


/*** EOF ***/
